VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Instancer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "Used to create a local instance of a server after a remote instance has been created."
Option Explicit
Public Function Object(ByVal sProgID As String) As Object
Attribute Object.VB_Description = "Returns a new instance of a server whose ProgID matches the sProgID parameter."
    '-------------------------------------------------------------------------
    'Purpose:
    '   This public class is a work around for error
    '   -2147221166 (80040152) which occurrs every time a client
    '   object creates an instance of a remote server,
    '   destroys it, registers it local, and tries to
    '   create a local instance.  The client can not
    '   create an object registered locally after it created
    '   an instance while it was registered remotely
    '   until it shuts down and restart.  Therefore,
    '   it works to call another process to create the
    '   local instance and pass it back.
    'In:
    '   [sProgID]
    '       ProgID of needed object
    'Return:
    '   Object created using the passed progId
    '-------------------------------------------------------------------------
    Set Object = CreateObject(sProgID)
End Function
